#include <iostream>
#include <windows.h>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <ctime>

using namespace std;
static void record()
{
	time_t now = time(NULL); // time，date
	tm time = *localtime(&now);//(&now)
	int year = time.tm_year + 1900;
	int month = time.tm_mon + 1;
	int day = time.tm_mday;
	int hour = time.tm_hour;
	int min = time.tm_min;
	int sec = time.tm_sec;
	
	ofstream ofsLog;
	ofsLog.open("frage10x-2.resr", ios::app);
	ofsLog << "-----------------------" << endl;
	ofsLog << "check time:" << year << "." << month << "." << day << "  " << hour << ":" << min << ":" << sec << endl;
	ofsLog << "有人在下课时间玩B站！" << endl;
	ofsLog << "-----------------------\n" << endl;
	ofsLog.close();
}

using namespace std;
int main()
{
	system("color f7");
	
	time_t now = time(NULL); // time，date
	tm time = *localtime(&now);//(&now)
	int year = time.tm_year + 1900;
	int month = time.tm_mon + 1;
	int day = time.tm_mday;
	int hour = time.tm_hour;
	int min = time.tm_min;
	int sec = time.tm_sec;
	
	record();
	
	return 0;
}
